<template>
    <div>
    <div class="crumbs">
        <el-breadcrumb>
            <el-breadcrumb-item> <i class="el-icon-lx-calendar"></i> 系统管理 </el-breadcrumb-item>
            <el-breadcrumb-item> 支付 </el-breadcrumb-item>
        </el-breadcrumb>
    </div>
	<div style="margin-left:320px;margin-right:320px;">
    <el-main class="post-article">
     <el-form id="#create" :model="create" :rules="rules" ref="create" label-width="40%">
            <el-form-item label="商品名称" prop="lawName">
                <el-input v-model="create.commodityName"></el-input>
            </el-form-item>
            <el-form-item label="商品描述" prop="inputPerson">
                <el-input v-model="create.commodityDetail"></el-input>
            </el-form-item>
            <el-form-item label="价格" prop="lawDetail">
                <el-input v-model="create.money"></el-input>
            </el-form-item>
            <el-button type="primary" @click="submit()" style="margin-left:650px;">提交订单</el-button>
     </el-form>
    </el-main>
 </div>
 </div>
</template>


<script>
export default {
	data: function(){
        return{
            create: {
                commodityName: '华为蓝牙耳机AM6',
                commodityDetail: '红色磁吸',
                money: '100'
            }
        }
    },
    methods:{
        submit(){
           this.postRequest("/alipay/page/gotoPayPage", {
                commodityName: this.create.commodityName,
                commodityDetail: this.create.commodityDetail,
                money:this.create.money
            }).then(successResponse => {
                this.responseResult = JSON.stringify(successResponse.data);
                console.log("html---->"+successResponse.data.html)
                var html = successResponse.data.html;
                document.write(html);
            })
            .catch(failResponse => {
                this.$message.error("服务器错误");
            });
        }

    }
}
</script>